package com.eastfair.venueservice.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import com.eastfair.database.mybatis.typehandler.M9EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

/**
 * 智慧物流服务-物流订单
 *
 * @author Du Xiaobo
 * @date 2023/5/9 10:38
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value="vsm_logistics_load",autoResultMap = true)
@ApiModel(value = "LoadInfo", description = "智慧物流服务-物流订单")
@AllArgsConstructor
public class LogisticsOrder extends Entity<Long> implements EchoVO {
    private static final long serialVersionUID = -1830937376922410800L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();

    /**
     * 是否启用（确认状态）：1是 已确认；0否 未确认
     */
    @ApiModelProperty(value = "是否启用（确认状态）：1是 已确认；0否 未确认")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用（确认状态）：1是 已确认；0否 未确认")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;


    /**
     * 主体类型
     */
    @ApiModelProperty(value = "主体类型")
    @TableField(value = "principal_type")
    @Excel(name = "主体类型")
    private String principalType;

    /**
     * 企业名称
     */
    @ApiModelProperty(value = "企业名称")
    @TableField(value = "enterprise_name")
    @Excel(name = "企业名称")
    private String enterpriseName;

    /**
     * 社会统一代码
     */
    @ApiModelProperty(value = "社会统一代码")
    @TableField(value = "social_unified_code")
    @Excel(name = "社会统一代码")
    private String socialUnifiedCode;

    /**
     * 展会id
     */
    @ApiModelProperty(value = "展会id")
    @TableField(value = "exhibition_id")
    @Excel(name = "展会id")
    private Long exhibitionId;

    /**
     * 展会名称
     */
    @ApiModelProperty(value = "展会名称")
    @TableField(value = "exhibition_name")
    @Excel(name = "展会名称")
    private String exhibitionName;

    /**
     * 展厅号
     */
    @ApiModelProperty(value = "展厅号")
    @TableField(value = "exhibition_hall_no")
    @Excel(name = "展厅号")
    private String exhibitionHallNo;

    /**
     * 展位号
     */
    @ApiModelProperty(value = "展位号")
    @TableField(value = "booth_no")
    @Excel(name = "展位号")
    private String boothNo;

    /**
     * 联系人
     */
    @ApiModelProperty(value = "联系人")
    @TableField(value = "contact")
    @Excel(name = "联系人")
    private String contact;

    /**
     * 联系方式
     */
    @ApiModelProperty(value = "联系方式")
    @TableField(value = "telephone",typeHandler = M9EncryptHandler.class)
    @Excel(name = "联系方式")
    private String telephone;

    /**
     * 支付方式
     */
    @ApiModelProperty(value = "支付方式")
    @TableField(value = "pay_type")
    @Excel(name = "支付方式")
    private String payType;

    /**
     * 付款时间
     */
    @ApiModelProperty(value = "付款时间")
    @TableField(value = "pay_time")
    @Excel(name = "付款时间")
    private LocalDateTime payTime;

    /**
     * 订单金额
     */
    @ApiModelProperty(value = "订单金额")
    @TableField(value = "amount")
    @Excel(name = "订单金额")
    private BigDecimal amount;

    /**
     * 实付金额
     */
    @ApiModelProperty(value = "实付金额")
    @TableField(value = "payed_amount")
    @Excel(name = "实付金额")
    private BigDecimal payedAmount;

    /**
     * 优惠金额
     */
    @ApiModelProperty(value = "优惠金额")
    @TableField(value = "discount_amount")
    @Excel(name = "优惠金额")
    private BigDecimal discountAmount;

    /**
     * 服务合计金额
     */
    @ApiModelProperty(value = "服务合计金额")
    @TableField(value = "service_total_amount")
    @Excel(name = "服务合计金额")
    private BigDecimal serviceTotalAmount;

    /**
     * 备注信息
     */
    @ApiModelProperty(value = "备注信息")
    @TableField(value = "remarks")
    @Excel(name = "备注信息")
    private String remarks;

    /**
     * 订单编号
     */
    @ApiModelProperty(value = "订单编号")
    @TableField(value = "order_num")
    @Excel(name = "订单编号")
    private String orderNum;

    /**
     * 下单时间
     */
    @ApiModelProperty(value = "下单时间")
    @TableField(value = "submit_time")
    @Excel(name = "下单时间")
    private LocalDateTime submitTime;

    /**
     * 订单类型
     */
    @ApiModelProperty(value = "订单类型")
    @TableField(value = "order_type")
    @Excel(name = "订单类型")
    private String orderType;

    /**
     * 付款状态
     */
    @ApiModelProperty(value = "付款状态")
    @TableField(value = "pay_status")
    @Excel(name = "付款状态")
    private String payStatus;

    /**
     * 开票状态
     */
    @ApiModelProperty(value = "开票状态")
    @TableField(value = "invoice_status")
    @Excel(name = "开票状态")
    private String invoiceStatus;

    /**
     * 收款单位
     */
    @ApiModelProperty(value = "收款单位")
    @TableField(value = "payee")
    @Excel(name = "收款单位")
    private String payee;

    /**
     * 明细
     */
    @ApiModelProperty(value = "明细")
    @TableField(value = "details")
    @Excel(name = "明细")
    private String details;

    @Builder
    public LogisticsOrder(Long id, LocalDateTime createTime, Long createdBy, LocalDateTime updateTime, Long updatedBy, Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, String principalType, String enterpriseName, String socialUnifiedCode, Long exhibitionId, String exhibitionName, String exhibitionHallNo, String boothNo, String contact, String telephone, String payType, LocalDateTime payTime, BigDecimal amount, BigDecimal payedAmount, BigDecimal discountAmount, BigDecimal serviceTotalAmount, String remarks, String orderNum, LocalDateTime submitTime, String orderType, String payStatus, String invoiceStatus,String payee, String details) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.principalType = principalType;
        this.enterpriseName = enterpriseName;
        this.socialUnifiedCode = socialUnifiedCode;
        this.exhibitionId = exhibitionId;
        this.exhibitionName = exhibitionName;
        this.exhibitionHallNo = exhibitionHallNo;
        this.boothNo = boothNo;
        this.contact = contact;
        this.telephone = telephone;
        this.payType = payType;
        this.payTime = payTime;
        this.amount = amount;
        this.payedAmount = payedAmount;
        this.discountAmount = discountAmount;
        this.serviceTotalAmount = serviceTotalAmount;
        this.remarks = remarks;
        this.orderNum = orderNum;
        this.submitTime = submitTime;
        this.orderType = orderType;
        this.payStatus = payStatus;
        this.invoiceStatus = invoiceStatus;
        this.payee = payee;
        this.details = details;
    }
}
